package com.seminario.spring.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class Perfil implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5689167856355412815L;
	private Integer id;
	private Usuario user;
	private List<Amistad> amigos;

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE)
	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@OneToOne(cascade=CascadeType.ALL)
	public Usuario getUser() {
		return user;
	}

	public void setUser(Usuario user) {
		this.user = user;
	}

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "perfil")
	public List<Amistad> getAmigos() {
		return amigos;
	}

	public void setAmigos(List<Amistad> amigos) {
		this.amigos = amigos;
	}

	

}
